/*
 * *
 *  * <pre>
 *  *     author : ${USER}
 *  *     e-mail : xxx@xx
 *  *     time   : ${YEAR}/${MONTH}/${DAY}
 *  *     desc   :
 *  *     version: 1.0
 *  * </pre>
 *
 */

package com.ovopark.firecar.bean;

import java.io.Serializable;

/**
 * 刷新token实体类.
 * 通知主页面，需要刷洗token了.
 * @author caixingming 2020/11/23.
 */
public class UserToken implements Serializable {

    /**
     * token不存在（被挤下线）
     */
    public static final String ERROR_CODE_TOKEN_NOT_EXIST = "9990001";
    /**
     * token超过可刷新时间
     */
    public static final String ERROR_CODE_TOKEN_EXPIRED = "9990003";


    private String userId;//用户id.
    private String token; //新toekn .
    private Long tokenExpirationTimestamp; //token过期时间戳
    private Long refreshExpirationTimestamp; //token刷新过期时间戳 .
    private Long createAtTimestamp; //创建时间戳
    private String loginType;//登录类型1web2ios3Android

    private String result ;//
    private String errordescription;//错误描述

    /**
     * 是否立即执行token刷新.
     */
    private boolean isRefreshNow = false;


    public UserToken() {
    }

    /**
     * 是否立刻执行刷新.
     * @param isRefreshNow
     */
    public UserToken(boolean isRefreshNow) {
        this.isRefreshNow = isRefreshNow;
    }

    public boolean isRefreshNow() {
        return isRefreshNow;
    }

    public void setRefreshNow(boolean refreshNow) {
        isRefreshNow = refreshNow;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Long getTokenExpirationTimestamp() {
        return tokenExpirationTimestamp;
    }

    public void setTokenExpirationTimestamp(Long tokenExpirationTimestamp) {
        this.tokenExpirationTimestamp = tokenExpirationTimestamp;
    }

    public Long getRefreshExpirationTimestamp() {
        return refreshExpirationTimestamp;
    }

    public void setRefreshExpirationTimestamp(Long refreshExpirationTimestamp) {
        this.refreshExpirationTimestamp = refreshExpirationTimestamp;
    }

    public Long getCreateAtTimestamp() {
        return createAtTimestamp;
    }

    public void setCreateAtTimestamp(Long createAtTimestamp) {
        this.createAtTimestamp = createAtTimestamp;
    }

    public String getLoginType() {
        return loginType;
    }

    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getErrordescription() {
        return errordescription;
    }

    public void setErrordescription(String errordescription) {
        this.errordescription = errordescription;
    }
}
